<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>常见问题 | LinCMS-TP5入门</title>
    <meta name="generator" content="VuePress 1.5.0">
    
    <meta name="description" content="基于ThinkPHP 5.1的 Lin CMS 后端实现。">
    <link rel="preload" href="/lin-cms-book/assets/css/0.styles.e8c0fe6e.css" as="style"><link rel="preload" href="/lin-cms-book/assets/js/app.43f3ff7b.js" as="script"><link rel="preload" href="/lin-cms-book/assets/js/2.1c264783.js" as="script"><link rel="preload" href="/lin-cms-book/assets/js/8.03718c42.js" as="script"><link rel="prefetch" href="/lin-cms-book/assets/js/10.b29049a1.js"><link rel="prefetch" href="/lin-cms-book/assets/js/11.5fc2ad3e.js"><link rel="prefetch" href="/lin-cms-book/assets/js/12.0fb72fc4.js"><link rel="prefetch" href="/lin-cms-book/assets/js/3.12364cb0.js"><link rel="prefetch" href="/lin-cms-book/assets/js/4.606d0aff.js"><link rel="prefetch" href="/lin-cms-book/assets/js/5.7bb207a9.js"><link rel="prefetch" href="/lin-cms-book/assets/js/6.1906fec0.js"><link rel="prefetch" href="/lin-cms-book/assets/js/7.2d983749.js"><link rel="prefetch" href="/lin-cms-book/assets/js/9.2e1a8f4e.js">
    <link rel="stylesheet" href="/lin-cms-book/assets/css/0.styles.e8c0fe6e.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/lin-cms-book/" class="home-link router-link-active"><!----> <span class="site-name">LinCMS-TP5入门</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/lin-cms-book/" class="nav-link">
  简介
</a></div><div class="nav-item"><a href="/lin-cms-book/start/server_deploy.html" class="nav-link">
  入门
</a></div><div class="nav-item"><a href="/lin-cms-book/dev/" class="nav-link">
  开发文档
</a></div><div class="nav-item"><a href="/lin-cms-book/log/" class="nav-link">
  版本日志
</a></div><div class="nav-item"><a href="/lin-cms-book/qa/" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  常见问题
</a></div><div class="nav-item"><a href="http://doc.cms.7yue.pro/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  林间有风
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://github.com/ChenJinchuang/lin-cms-tp5" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/lin-cms-book/" class="nav-link">
  简介
</a></div><div class="nav-item"><a href="/lin-cms-book/start/server_deploy.html" class="nav-link">
  入门
</a></div><div class="nav-item"><a href="/lin-cms-book/dev/" class="nav-link">
  开发文档
</a></div><div class="nav-item"><a href="/lin-cms-book/log/" class="nav-link">
  版本日志
</a></div><div class="nav-item"><a href="/lin-cms-book/qa/" aria-current="page" class="nav-link router-link-exact-active router-link-active">
  常见问题
</a></div><div class="nav-item"><a href="http://doc.cms.7yue.pro/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  林间有风
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://github.com/ChenJinchuang/lin-cms-tp5" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="常见问题"><a href="#常见问题" class="header-anchor">#</a> 常见问题</h1> <h2 id="q1：项目运行起来后，登陆成功但提示未获取到请求未携带authorization信息"><a href="#q1：项目运行起来后，登陆成功但提示未获取到请求未携带authorization信息" class="header-anchor">#</a> <strong>Q1：项目运行起来后，登陆成功但提示未获取到请求未携带authorization信息</strong></h2> <p>A：这是由于运行环境的web服务器配置导致，多见于Apache环境，过滤了前端请求中的authorization头信息，可尝试修后端<code>lin-cms-tp5\public\.htaccess</code>文件为以下内容：</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token operator">&lt;</span>IfModule mod_rewrite.c<span class="token operator">&gt;</span>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On
  SetEnvIf Authorization <span class="token string">&quot;(.*)&quot;</span> <span class="token assign-left variable">HTTP_AUTHORIZATION</span><span class="token operator">=</span><span class="token variable">$1</span>
  RewriteCond %<span class="token punctuation">{</span>REQUEST_FILENAME<span class="token punctuation">}</span> <span class="token operator">!</span>-d
  RewriteCond %<span class="token punctuation">{</span>REQUEST_FILENAME<span class="token punctuation">}</span> <span class="token operator">!</span>-f
  RewriteRule ^<span class="token punctuation">(</span>.*<span class="token punctuation">)</span>$ index.php/<span class="token variable">$1</span> <span class="token punctuation">[</span>QSA,PT,L<span class="token punctuation">]</span>
<span class="token operator">&lt;</span>/IfModule<span class="token operator">&gt;</span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h2 id="q2：运行-php-think-migrate-run后提示sqlstate-42000-syntax-error-or-access-violation-1067-invalid-default-value-for-end-time"><a href="#q2：运行-php-think-migrate-run后提示sqlstate-42000-syntax-error-or-access-violation-1067-invalid-default-value-for-end-time" class="header-anchor">#</a> <strong>Q2：运行 php think migrate:run后提示SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value  for 'end_time'</strong></h2> <p>A：这个是MySQL配置问题，解决办法参考：<a href="http://blog.sina.com.cn/s/blog_6798fbff0102wza4.html" target="_blank" rel="noopener noreferrer">http://blog.sina.com.cn/s/blog_6798fbff0102wza4.html<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h2 id="q3：lin-cms-vue在运行npm-run-server后提示cannot-read-property-range-of-null"><a href="#q3：lin-cms-vue在运行npm-run-server后提示cannot-read-property-range-of-null" class="header-anchor">#</a> <strong>Q3：lin-cms-vue在运行npm run server后提示Cannot read property 'range' of null</strong></h2> <p>A: 这个是项目的依赖安装或者本地环境出了问题了，有两种解决办法：</p> <ul><li>方式一（推荐）：</li></ul> <ol><li><p>删除lin-cms-vue根目录下的<code>node_module</code>文件夹</p></li> <li><p>在工程根目录下使用命令行工具，依次运行如下命令：</p></li></ol> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token comment"># 清空缓存</span>
<span class="token function">npm</span> cache clean -f
<span class="token comment"># 设置npm源为淘宝源</span>
<span class="token function">npm</span> config <span class="token builtin class-name">set</span> registry https://registry.npm.taobao.org
<span class="token comment"># 设置node_sass安装源为淘宝源</span>
<span class="token function">npm</span> config <span class="token builtin class-name">set</span> sass_binary_site https://npm.taobao.org/mirrors/node-sass
<span class="token comment"># 安装依赖 </span>
<span class="token function">npm</span> <span class="token function">install</span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><ul><li>方式二</li></ul> <p>如果方式一行不通，那么就修改项目根目录下的<code>package.json</code>文件，将<code>babel-eslint</code>这个依赖的版本号指定为<code>8.0.1</code></p> <h2 id="q4：mac环境下运行-php-think-migrate-run后提示sqlstate-hy000-2002-no-such-file-or-directory"><a href="#q4：mac环境下运行-php-think-migrate-run后提示sqlstate-hy000-2002-no-such-file-or-directory" class="header-anchor">#</a> **Q4：MAC环境下运行 php think migrate:run后提示SQLSTATE[HY000][2002] No Such file or directory **</h2> <p>A：MAC环境下的类库BUG，可以参考<a href="http://www.thinkphp.cn/topic/56453.html" target="_blank" rel="noopener noreferrer">http://www.thinkphp.cn/topic/56453.html<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新时间:</span> <span class="time">10/7/2020, 11:20:01 PM</span></div></footer> <!----> </main></div><div class="global-ui"></div></div>
    <script src="/lin-cms-book/assets/js/app.43f3ff7b.js" defer></script><script src="/lin-cms-book/assets/js/2.1c264783.js" defer></script><script src="/lin-cms-book/assets/js/8.03718c42.js" defer></script>
  </body>
</html>
